﻿
using FreeSql.DataAnnotations;

namespace System.FileServer.Models
{
    /// <summary>
    /// 文件数据库模型
    /// </summary>
    [Table(Name = "SavedFiles")]
    public class FileDBModel
    {
        /// <summary>
        /// 文件ID
        /// </summary>
        [Column(IsPrimary = true)]
        public long FID { get; set; } = LuanNiao.Core.IDGen.GetInstance().NextId();
        /// <summary>
        /// 当前名称
        /// </summary>
        public string CurrentName { get; set; } = Guid.NewGuid().ToString("N");
        /// <summary>
        /// 原始名称
        /// </summary>
        public string OriginalName { get; set; } = string.Empty;
        /// <summary>
        /// 文件HTTP扩展类型
        /// </summary>
        public string MimeType { get; set; } = string.Empty;
        /// <summary>
        /// 文件类型
        /// </summary>
        public string Type { get; set; } = string.Empty;
        /// <summary>
        /// 文件大小
        /// </summary>
        public long Size { get; set; } = 0;
        /// <summary>
        /// 当前存储节点名
        /// </summary>
        public string CurrentPointName { get; set; } = string.Empty;
        /// <summary>
        /// 校验码
        /// </summary>
        public string CheckCode { get; set; } = string.Empty;
        /// <summary>
        /// 文件存储路径
        /// </summary>
        public string FileSavePath { get; set; } = string.Empty;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created { get; set; } = DateTime.Now;
        /// <summary>
        /// 创建人
        /// </summary>
        public long CreatedBy { get; set; }
        /// <summary>
        /// 修改日期
        /// </summary>
        public DateTime Modified { get; set; } = DateTime.Now;
        /// <summary>
        /// 修改人
        /// </summary>
        public long ModifiedBy { get; set; }
    }
}
